home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / doom / dreamsoi.zip / PLAY.BAT < prev   
DOS Batch File  |  1997-05-11  |  2KB  |  77 lines

  1. @echo off
  2.  
  3. REM This program launches DOOM II. Lets you, on the command line, 
  4. REM choose which map to start on, skill and which wadfile(s) to 
  5. REM load. Is to be used together with the program ENTER.COM.
  6.  
  7. REM Author:     Magnus Ander 
  8. REM Email:      m94man@student.tdb.uu.se
  9. REM             m96maa@student.docs.uu.se
  10. REM             paranoia@[194.22.170.29]
  11.              
  12. REM Date: May the 8th 1997
  13.  
  14. REM The 1st argument (%1) is the mapnumber (1 - 32).
  15. REM The 2nd argument (%2) is the skill (1 - 5).
  16. REM Give the wadfiles as a set of arguments with the first 
  17. REM giving the directory where the wadfiles are stored.
  18.  
  19.  
  20.  
  21. REM You must give at least three arguments!
  22. if "%3"=="" goto help
  23. if not exist %3\nul goto continue
  24.  
  25. REM If the third argument is a directory, there must be a fourth!
  26. if "%4"=="" goto help
  27.  
  28. REM The number of arguments was OK, continue!
  29. :continue
  30. set warp=-warp %1
  31. set skill=-skill %2
  32.  
  33. REM Tell DOOM II to load each wadfile given on the command line.
  34. shift
  35. set files=-file
  36. :makefileoption
  37.   shift
  38.   if "%1"=="" goto stop
  39.   if not exist %1\nul goto isfile 
  40.   set dirname=%1\
  41.   shift
  42.   if exist %1\nul goto help
  43.   if "%1"=="" goto help
  44.   :isfile
  45.   if not exist %dirname%%1 goto ferror
  46.   set files=%files% %dirname%%1
  47. goto makefileoption 
  48. :stop
  49.  
  50. REM Start DOOM II at the given level and with the given skill.
  51. enter
  52. doom2 %files% %warp% %skill%
  53. goto delete
  54.  
  55. REM The given wadfile does not exist!
  56. :ferror
  57.   echo.
  58.   echo Error - The file "%dirname%%1" does not exist!
  59.   echo.
  60.  
  61. REM Delete every environment variable used.
  62. :delete
  63.   set warp=
  64.   set skill=
  65.   set files=
  66.   set dirname=
  67. goto end
  68.  
  69. REM The number of arguments was not enough, show some help.
  70. :help
  71.   echo.
  72.   echo syntax: PLAY map skill ((wadfile or {directory wadfile ...}) ...)
  73.   echo.
  74.  
  75. REM End of program.
  76. :end
  77.